home *** CD-ROM | disk | FTP | other *** search
/ Macworld Expo - Develope…Central & Net Innovations / Developer Central and Net Innovators (MacWorld Expo) (January 1999).iso / Developer Central / Bowers Development / Demo AppMaker / Examples / PowerPlant / Everything / DDocData.cp < prev    next >
Encoding:
Text File  |  1998-10-11  |  12.2 KB  |  923 lines  |  [TEXT/CWIE]

  1. // DDocData.cp -- data container class for Everything
  2.  
  3. #include "DDocData.h"
  4.  
  5. #include <LFileStream.h>
  6.  
  7.  
  8. //----------
  9. DDocData::DDocData ()
  10. {
  11.     mStandard = false;
  12.     mXx = false;
  13.     mLR = false;
  14.     mLR2 = false;
  15.     mLR3 = false;
  16.     mLR4 = false;
  17.     mCheckbox = false;
  18.     mCheckbox2 = false;
  19.     mNext = false;
  20.     mNext2 = false;
  21.     mRadioGroup = 0;
  22.     mGroup = 0;
  23.     mGraphic = 0;
  24.     mBevel = 0;
  25.     mText = 0;
  26.     LString::CopyPStr ("\pSmall", mSmall);
  27.     LString::CopyPStr ("\pLarge", mLarge);
  28.     mX12345 = 12345;
  29.     mX12345e6 = 123.45e6;
  30.     LString::CopyPStr ("\pPassword", mPassword);
  31.     GetLongDateTime (&mDate);
  32.     GetLongDateTime (&mTime);
  33.     LString::CopyPStr ("\p", mStyled);
  34.     mBars = 0;
  35.     mStandard2 = 5;
  36.     mGraphic2 = 5;
  37.     mSlider = 5;
  38.     mTickMarks = 5;
  39.     mNonDirectional = 5;
  40.     mLittleArrows = 0;
  41.     mSpinner = 5;
  42.     mVolumeControl = 5;
  43.     mJimSSlider = 5;
  44.     mStandard3 = 5;
  45.     mIndeterminate = 0;
  46.     mChasingArrows = 0;
  47.     mRectangle = 5;
  48.     mRoundRect = 5;
  49.     mBarberPole = 0;
  50.     mRoundBarber = 0;
  51.     mTools = 0;
  52.     mFromValuesList2 = 0;
  53.     mFromMenu = 0;
  54.     mTextList = 0;
  55. }
  56.  
  57. //----------
  58. DDocData::~DDocData ()
  59. {
  60. }
  61.  
  62. //----------
  63. void    DDocData::CopyFrom (
  64.     DDocData*        inOther)
  65. {
  66.     mStandard = inOther->mStandard;
  67.     mXx = inOther->mXx;
  68.     mLR = inOther->mLR;
  69.     mLR2 = inOther->mLR2;
  70.     mLR3 = inOther->mLR3;
  71.     mLR4 = inOther->mLR4;
  72.     mCheckbox = inOther->mCheckbox;
  73.     mCheckbox2 = inOther->mCheckbox2;
  74.     mNext = inOther->mNext;
  75.     mNext2 = inOther->mNext2;
  76.     mRadioGroup = inOther->mRadioGroup;
  77.     mGroup = inOther->mGroup;
  78.     mGraphic = inOther->mGraphic;
  79.     mBevel = inOther->mBevel;
  80.     mText = inOther->mText;
  81.     LString::CopyPStr (inOther->mSmall, mSmall);
  82.     LString::CopyPStr (inOther->mLarge, mLarge);
  83.     mX12345 = inOther->mX12345;
  84.     mX12345e6 = inOther->mX12345e6;
  85.     LString::CopyPStr (inOther->mPassword, mPassword);
  86.     mDate = inOther->mDate;
  87.     mTime = inOther->mTime;
  88.     LString::CopyPStr (inOther->mStyled, mStyled);
  89.     mBars = inOther->mBars;
  90.     mStandard2 = inOther->mStandard2;
  91.     mGraphic2 = inOther->mGraphic2;
  92.     mSlider = inOther->mSlider;
  93.     mTickMarks = inOther->mTickMarks;
  94.     mNonDirectional = inOther->mNonDirectional;
  95.     mLittleArrows = inOther->mLittleArrows;
  96.     mSpinner = inOther->mSpinner;
  97.     mVolumeControl = inOther->mVolumeControl;
  98.     mJimSSlider = inOther->mJimSSlider;
  99.     mStandard3 = inOther->mStandard3;
  100.     mIndeterminate = inOther->mIndeterminate;
  101.     mChasingArrows = inOther->mChasingArrows;
  102.     mRectangle = inOther->mRectangle;
  103.     mRoundRect = inOther->mRoundRect;
  104.     mBarberPole = inOther->mBarberPole;
  105.     mRoundBarber = inOther->mRoundBarber;
  106.     mTools = inOther->mTools;
  107.     mFromValuesList2 = inOther->mFromValuesList2;
  108.     mFromMenu = inOther->mFromMenu;
  109.     mTextList = inOther->mTextList;
  110. }
  111.  
  112. //----------
  113. void    DDocData::ReadFromFile (
  114.     LFileStream*    inFile)
  115. {
  116. }
  117.  
  118. //----------
  119. void    DDocData::WriteToFile (
  120.     LFileStream*    inFile)
  121. {
  122. }
  123.  
  124.  
  125. //----------
  126. Boolean        DDocData::GetStandard () const
  127. {
  128.  
  129.     return mStandard;
  130. }
  131.  
  132. //----------
  133. void    DDocData::SetStandard (
  134.     Boolean        inValue)
  135. {
  136.     mStandard = inValue;
  137.     
  138.     SignalDataChanged (idStandard);
  139. }
  140.  
  141.  
  142. //----------
  143. Boolean        DDocData::GetXx () const
  144. {
  145.  
  146.     return mXx;
  147. }
  148.  
  149. //----------
  150. void    DDocData::SetXx (
  151.     Boolean        inValue)
  152. {
  153.     mXx = inValue;
  154.     
  155.     SignalDataChanged (idXx);
  156. }
  157.  
  158.  
  159. //----------
  160. Boolean        DDocData::GetLR () const
  161. {
  162.  
  163.     return mLR;
  164. }
  165.  
  166. //----------
  167. void    DDocData::SetLR (
  168.     Boolean        inValue)
  169. {
  170.     mLR = inValue;
  171.     
  172.     SignalDataChanged (idLR);
  173. }
  174.  
  175.  
  176. //----------
  177. Boolean        DDocData::GetLR2 () const
  178. {
  179.  
  180.     return mLR2;
  181. }
  182.  
  183. //----------
  184. void    DDocData::SetLR2 (
  185.     Boolean        inValue)
  186. {
  187.     mLR2 = inValue;
  188.     
  189.     SignalDataChanged (idLR2);
  190. }
  191.  
  192.  
  193. //----------
  194. Boolean        DDocData::GetLR3 () const
  195. {
  196.  
  197.     return mLR3;
  198. }
  199.  
  200. //----------
  201. void    DDocData::SetLR3 (
  202.     Boolean        inValue)
  203. {
  204.     mLR3 = inValue;
  205.     
  206.     SignalDataChanged (idLR3);
  207. }
  208.  
  209.  
  210. //----------
  211. Boolean        DDocData::GetLR4 () const
  212. {
  213.  
  214.     return mLR4;
  215. }
  216.  
  217. //----------
  218. void    DDocData::SetLR4 (
  219.     Boolean        inValue)
  220. {
  221.     mLR4 = inValue;
  222.     
  223.     SignalDataChanged (idLR4);
  224. }
  225.  
  226.  
  227. //----------
  228. Boolean        DDocData::GetCheckbox () const
  229. {
  230.  
  231.     return mCheckbox;
  232. }
  233.  
  234. //----------
  235. void    DDocData::SetCheckbox (
  236.     Boolean        inValue)
  237. {
  238.     mCheckbox = inValue;
  239.     
  240.     SignalDataChanged (idCheckbox);
  241. }
  242.  
  243.  
  244. //----------
  245. Boolean        DDocData::GetCheckbox2 () const
  246. {
  247.  
  248.     return mCheckbox2;
  249. }
  250.  
  251. //----------
  252. void    DDocData::SetCheckbox2 (
  253.     Boolean        inValue)
  254. {
  255.     mCheckbox2 = inValue;
  256.     
  257.     SignalDataChanged (idCheckbox2);
  258. }
  259.  
  260.  
  261. //----------
  262. Boolean        DDocData::GetNext () const
  263. {
  264.  
  265.     return mNext;
  266. }
  267.  
  268. //----------
  269. void    DDocData::SetNext (
  270.     Boolean        inValue)
  271. {
  272.     mNext = inValue;
  273.     
  274.     SignalDataChanged (idNext);
  275. }
  276.  
  277.  
  278. //----------
  279. Boolean        DDocData::GetNext2 () const
  280. {
  281.  
  282.     return mNext2;
  283. }
  284.  
  285. //----------
  286. void    DDocData::SetNext2 (
  287.     Boolean        inValue)
  288. {
  289.     mNext2 = inValue;
  290.     
  291.     SignalDataChanged (idNext2);
  292. }
  293.  
  294.  
  295. //----------
  296. SInt16        DDocData::GetRadioGroup () const
  297. {
  298.  
  299.     return mRadioGroup;
  300. }
  301.  
  302. //----------
  303. void    DDocData::SetRadioGroup (
  304.     SInt16        inValue)
  305. {
  306.     mRadioGroup = inValue;
  307.     
  308.     SignalDataChanged (idRadioGroup);
  309. }
  310.  
  311.  
  312. //----------
  313. SInt16        DDocData::GetGroup () const
  314. {
  315.  
  316.     return mGroup;
  317. }
  318.  
  319. //----------
  320. void    DDocData::SetGroup (
  321.     SInt16        inValue)
  322. {
  323.     mGroup = inValue;
  324.     
  325.     SignalDataChanged (idGroup);
  326. }
  327.  
  328.  
  329. //----------
  330. SInt16        DDocData::GetGraphic () const
  331. {
  332.  
  333.     return mGraphic;
  334. }
  335.  
  336. //----------
  337. void    DDocData::SetGraphic (
  338.     SInt16        inValue)
  339. {
  340.     mGraphic = inValue;
  341.     
  342.     SignalDataChanged (idGraphic);
  343. }
  344.  
  345.  
  346. //----------
  347. SInt16        DDocData::GetBevel () const
  348. {
  349.  
  350.     return mBevel;
  351. }
  352.  
  353. //----------
  354. void    DDocData::SetBevel (
  355.     SInt16        inValue)
  356. {
  357.     mBevel = inValue;
  358.     
  359.     SignalDataChanged (idBevel);
  360. }
  361.  
  362.  
  363. //----------
  364. SInt16        DDocData::GetText () const
  365. {
  366.  
  367.     return mText;
  368. }
  369.  
  370. //----------
  371. void    DDocData::SetText (
  372.     SInt16        inValue)
  373. {
  374.     mText = inValue;
  375.     
  376.     SignalDataChanged (idText);
  377. }
  378.  
  379.  
  380. //----------
  381. StringPtr    DDocData::GetSmall (
  382.     Str255        outPtr) const
  383. {
  384.  
  385.     if (outPtr != nil) {
  386.         LString::CopyPStr (mSmall, outPtr);
  387.     }
  388.     return (StringPtr)mSmall;
  389. }
  390.  
  391. //----------
  392. void    DDocData::SetSmall (
  393.     ConstStringPtr    inValue)
  394. {
  395.     LString::CopyPStr (inValue, mSmall);
  396.     
  397.     SignalDataChanged (idSmall);
  398. }
  399.  
  400. //----------
  401. void    DDocData::SetSmall (
  402.     CharsHandle        inValue)
  403. {
  404.     SetPStr (mSmall, sizeof (mSmall), inValue);
  405.     
  406.     SignalDataChanged (idSmall);
  407. }
  408.  
  409.  
  410. //----------
  411. StringPtr    DDocData::GetLarge (
  412.     Str255        outPtr) const
  413. {
  414.  
  415.     if (outPtr != nil) {
  416.         LString::CopyPStr (mLarge, outPtr);
  417.     }
  418.     return (StringPtr)mLarge;
  419. }
  420.  
  421. //----------
  422. void    DDocData::SetLarge (
  423.     ConstStringPtr    inValue)
  424. {
  425.     LString::CopyPStr (inValue, mLarge);
  426.     
  427.     SignalDataChanged (idLarge);
  428. }
  429.  
  430. //----------
  431. void    DDocData::SetLarge (
  432.     CharsHandle        inValue)
  433. {
  434.     SetPStr (mLarge, sizeof (mLarge), inValue);
  435.     
  436.     SignalDataChanged (idLarge);
  437. }
  438.  
  439.  
  440. //----------
  441. SInt32        DDocData::GetX12345 () const
  442. {
  443.  
  444.     return mX12345;
  445. }
  446.  
  447. //----------
  448. void    DDocData::SetX12345 (
  449.     SInt32        inValue)
  450. {
  451.     mX12345 = inValue;
  452.     
  453.     SignalDataChanged (idX12345);
  454. }
  455.  
  456.  
  457. //----------
  458. double        DDocData::GetX12345e6 () const
  459. {
  460.  
  461.     return mX12345e6;
  462. }
  463.  
  464. //----------
  465. void    DDocData::SetX12345e6 (
  466.     double        inValue)
  467. {
  468.     mX12345e6 = inValue;
  469.     
  470.     SignalDataChanged (idX12345e6);
  471. }
  472.  
  473.  
  474. //----------
  475. StringPtr    DDocData::GetPassword (
  476.     Str255        outPtr) const
  477. {
  478.  
  479.     if (outPtr != nil) {
  480.         LString::CopyPStr (mPassword, outPtr);
  481.     }
  482.     return (StringPtr)mPassword;
  483. }
  484.  
  485. //----------
  486. void    DDocData::SetPassword (
  487.     ConstStringPtr    inValue)
  488. {
  489.     LString::CopyPStr (inValue, mPassword);
  490.     
  491.     SignalDataChanged (idPassword);
  492. }
  493.  
  494. //----------
  495. void    DDocData::SetPassword (
  496.     CharsHandle        inValue)
  497. {
  498.     SetPStr (mPassword, sizeof (mPassword), inValue);
  499.     
  500.     SignalDataChanged (idPassword);
  501. }
  502.  
  503.  
  504. //----------
  505. LongDateRec        DDocData::GetDate () const
  506. {
  507.  
  508.     return mDate;
  509. }
  510.  
  511. //----------
  512. void    DDocData::SetDate (
  513.     LongDateRec        inValue)
  514. {
  515.     mDate = inValue;
  516.     
  517.     SignalDataChanged (idDate);
  518. }
  519.  
  520.  
  521. //----------
  522. LongDateRec        DDocData::GetTime () const
  523. {
  524.  
  525.     return mTime;
  526. }
  527.  
  528. //----------
  529. void    DDocData::SetTime (
  530.     LongDateRec        inValue)
  531. {
  532.     mTime = inValue;
  533.     
  534.     SignalDataChanged (idTime);
  535. }
  536.  
  537.  
  538. //----------
  539. StringPtr    DDocData::GetStyled (
  540.     Str255        outPtr) const
  541. {
  542.  
  543.     if (outPtr != nil) {
  544.         LString::CopyPStr (mStyled, outPtr);
  545.     }
  546.     return (StringPtr)mStyled;
  547. }
  548.  
  549. //----------
  550. void    DDocData::SetStyled (
  551.     ConstStringPtr    inValue)
  552. {
  553.     LString::CopyPStr (inValue, mStyled);
  554.     
  555.     SignalDataChanged (idStyled);
  556. }
  557.  
  558. //----------
  559. void    DDocData::SetStyled (
  560.     CharsHandle        inValue)
  561. {
  562.     SetPStr (mStyled, sizeof (mStyled), inValue);
  563.     
  564.     SignalDataChanged (idStyled);
  565. }
  566.  
  567.  
  568. //----------
  569. UInt16        DDocData::GetBars () const
  570. {
  571.  
  572.     return mBars;
  573. }
  574.  
  575. //----------
  576. void    DDocData::SetBars (
  577.     UInt16        inValue)
  578. {
  579.     mBars = inValue;
  580.     
  581.     SignalDataChanged (idBars);
  582. }
  583.  
  584.  
  585. //----------
  586. SInt16        DDocData::GetStandard2 () const
  587. {
  588.  
  589.     return mStandard2;
  590. }
  591.  
  592. //----------
  593. void    DDocData::SetStandard2 (
  594.     SInt16        inValue)
  595. {
  596.     mStandard2 = inValue;
  597.     
  598.     SignalDataChanged (idStandard2);
  599. }
  600.  
  601.  
  602. //----------
  603. SInt16        DDocData::GetGraphic2 () const
  604. {
  605.  
  606.     return mGraphic2;
  607. }
  608.  
  609. //----------
  610. void    DDocData::SetGraphic2 (
  611.     SInt16        inValue)
  612. {
  613.     mGraphic2 = inValue;
  614.     
  615.     SignalDataChanged (idGraphic2);
  616. }
  617.  
  618.  
  619. //----------
  620. SInt16        DDocData::GetSlider () const
  621. {
  622.  
  623.     return mSlider;
  624. }
  625.  
  626. //----------
  627. void    DDocData::SetSlider (
  628.     SInt16        inValue)
  629. {
  630.     mSlider = inValue;
  631.     
  632.     SignalDataChanged (idSlider);
  633. }
  634.  
  635.  
  636. //----------
  637. SInt16        DDocData::GetTickMarks () const
  638. {
  639.  
  640.     return mTickMarks;
  641. }
  642.  
  643. //----------
  644. void    DDocData::SetTickMarks (
  645.     SInt16        inValue)
  646. {
  647.     mTickMarks = inValue;
  648.     
  649.     SignalDataChanged (idTickMarks);
  650. }
  651.  
  652.  
  653. //----------
  654. SInt16        DDocData::GetNonDirectional () const
  655. {
  656.  
  657.     return mNonDirectional;
  658. }
  659.  
  660. //----------
  661. void    DDocData::SetNonDirectional (
  662.     SInt16        inValue)
  663. {
  664.     mNonDirectional = inValue;
  665.     
  666.     SignalDataChanged (idNonDirectional);
  667. }
  668.  
  669.  
  670. //----------
  671. SInt16        DDocData::GetLittleArrows () const
  672. {
  673.  
  674.     return mLittleArrows;
  675. }
  676.  
  677. //----------
  678. void    DDocData::SetLittleArrows (
  679.     SInt16        inValue)
  680. {
  681.     mLittleArrows = inValue;
  682.     
  683.     SignalDataChanged (idLittleArrows);
  684. }
  685.  
  686.  
  687. //----------
  688. SInt16        DDocData::GetSpinner () const
  689. {
  690.  
  691.     return mSpinner;
  692. }
  693.  
  694. //----------
  695. void    DDocData::SetSpinner (
  696.     SInt16        inValue)
  697. {
  698.     mSpinner = inValue;
  699.     
  700.     SignalDataChanged (idSpinner);
  701. }
  702.  
  703.  
  704. //----------
  705. SInt16        DDocData::GetVolumeControl () const
  706. {
  707.  
  708.     return mVolumeControl;
  709. }
  710.  
  711. //----------
  712. void    DDocData::SetVolumeControl (
  713.     SInt16        inValue)
  714. {
  715.     mVolumeControl = inValue;
  716.     
  717.     SignalDataChanged (idVolumeControl);
  718. }
  719.  
  720.  
  721. //----------
  722. SInt16        DDocData::GetJimSSlider () const
  723. {
  724.  
  725.     return mJimSSlider;
  726. }
  727.  
  728. //----------
  729. void    DDocData::SetJimSSlider (
  730.     SInt16        inValue)
  731. {
  732.     mJimSSlider = inValue;
  733.     
  734.     SignalDataChanged (idJimSSlider);
  735. }
  736.  
  737.  
  738. //----------
  739. SInt16        DDocData::GetStandard3 () const
  740. {
  741.  
  742.     return mStandard3;
  743. }
  744.  
  745. //----------
  746. void    DDocData::SetStandard3 (
  747.     SInt16        inValue)
  748. {
  749.     mStandard3 = inValue;
  750.     
  751.     SignalDataChanged (idStandard3);
  752. }
  753.  
  754.  
  755. //----------
  756. SInt16        DDocData::GetIndeterminate () const
  757. {
  758.  
  759.     return mIndeterminate;
  760. }
  761.  
  762. //----------
  763. void    DDocData::SetIndeterminate (
  764.     SInt16        inValue)
  765. {
  766.     mIndeterminate = inValue;
  767.     
  768.     SignalDataChanged (idIndeterminate);
  769. }
  770.  
  771.  
  772. //----------
  773. SInt16        DDocData::GetChasingArrows () const
  774. {
  775.  
  776.     return mChasingArrows;
  777. }
  778.  
  779. //----------
  780. void    DDocData::SetChasingArrows (
  781.     SInt16        inValue)
  782. {
  783.     mChasingArrows = inValue;
  784.     
  785.     SignalDataChanged (idChasingArrows);
  786. }
  787.  
  788.  
  789. //----------
  790. SInt16        DDocData::GetRectangle () const
  791. {
  792.  
  793.     return mRectangle;
  794. }
  795.  
  796. //----------
  797. void    DDocData::SetRectangle (
  798.     SInt16        inValue)
  799. {
  800.     mRectangle = inValue;
  801.     
  802.     SignalDataChanged (idRectangle);
  803. }
  804.  
  805.  
  806. //----------
  807. SInt16        DDocData::GetRoundRect () const
  808. {
  809.  
  810.     return mRoundRect;
  811. }
  812.  
  813. //----------
  814. void    DDocData::SetRoundRect (
  815.     SInt16        inValue)
  816. {
  817.     mRoundRect = inValue;
  818.     
  819.     SignalDataChanged (idRoundRect);
  820. }
  821.  
  822.  
  823. //----------
  824. SInt16        DDocData::GetBarberPole () const
  825. {
  826.  
  827.     return mBarberPole;
  828. }
  829.  
  830. //----------
  831. void    DDocData::SetBarberPole (
  832.     SInt16        inValue)
  833. {
  834.     mBarberPole = inValue;
  835.     
  836.     SignalDataChanged (idBarberPole);
  837. }
  838.  
  839.  
  840. //----------
  841. SInt16        DDocData::GetRoundBarber () const
  842. {
  843.  
  844.     return mRoundBarber;
  845. }
  846.  
  847. //----------
  848. void    DDocData::SetRoundBarber (
  849.     SInt16        inValue)
  850. {
  851.     mRoundBarber = inValue;
  852.     
  853.     SignalDataChanged (idRoundBarber);
  854. }
  855.  
  856.  
  857. //----------
  858. SInt16        DDocData::GetTools () const
  859. {
  860.  
  861.     return mTools;
  862. }
  863.  
  864. //----------
  865. void    DDocData::SetTools (
  866.     SInt16        inValue)
  867. {
  868.     mTools = inValue;
  869.     
  870.     SignalDataChanged (idTools);
  871. }
  872.  
  873.  
  874. //----------
  875. SInt16        DDocData::GetFromValuesList2 () const
  876. {
  877.  
  878.     return mFromValuesList2;
  879. }
  880.  
  881. //----------
  882. void    DDocData::SetFromValuesList2 (
  883.     SInt16        inValue)
  884. {
  885.     mFromValuesList2 = inValue;
  886.     
  887.     SignalDataChanged (idFromValuesList2);
  888. }
  889.  
  890.  
  891. //----------
  892. SInt16        DDocData::GetFromMenu () const
  893. {
  894.  
  895.     return mFromMenu;
  896. }
  897.  
  898. //----------
  899. void    DDocData::SetFromMenu (
  900.     SInt16        inValue)
  901. {
  902.     mFromMenu = inValue;
  903.     
  904.     SignalDataChanged (idFromMenu);
  905. }
  906.  
  907.  
  908. //----------
  909. SInt16        DDocData::GetTextList () const
  910. {
  911.  
  912.     return mTextList;
  913. }
  914.  
  915. //----------
  916. void    DDocData::SetTextList (
  917.     SInt16        inValue)
  918. {
  919.     mTextList = inValue;
  920.     
  921.     SignalDataChanged (idTextList);
  922. }
  923.